<%@page import="java.util.List"%>
<%@page import="model.entity.role.PageTask"%>
<%@page import="util.RoleUtil"%>
<%@page import="java.util.Set"%>
<%@page import="model.entity.role.PageFunction"%>
<%@page import="model.entity.role.Users"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>


<%
	Users user = (Users) session.getAttribute("user");
	if (user != null) {
		List<PageTask> listTask = user.getGroupRole().getPageTasks();
		Set<PageFunction> setFunction = RoleUtil.groupTask(listTask);
%>
<section id="secondary_bar">
	<div class="user">
		<p>
			<%=user.getFullName()%>
		</p>
		<!-- <a class="logout_user" href="#" title="Logout">Logout</a> -->
	</div>
	<div class="breadcrumbs_container">
		<article class="breadcrumbs">
			<a href="index.html">Fashion Shop</a>
			<div class="breadcrumb_divider"></div>
			<a class="current"><%=user.getGroupRole().getRoleName()%></a>
		</article>
	</div>
</section>
<!-- end of secondary bar -->

<aside id="sidebar" class="column">
	<% for (PageFunction func : setFunction) {%>
		<h3><%=func.getShortName()%></h3>
		<ul class="toggle">
			<% 
				for (PageTask task : listTask) {
					if(task.getPageFunction().equals(func)) {
			%>
				<li class="icn_categories"><a href="../<%=task.getCommandLink()%>"><%=task.getTaskName()%></a></li>
			<% }} %>
		</ul>
	<% } %>
	<h3>Test</h3>
	<ul class="toggle">
		<li class="icn_jump_back"><a href="#" onclick="confirmeSignOut();">Logout</a></li>
	</ul>

	<footer>
		<hr />
		<p>
			<strong>Copyright &copy; 100111 - DH10DT</strong>
		</p>
	</footer>
</aside>
<!-- end of sidebar -->
<%
	}
%>